﻿using System.Collections.Generic;
using WeiboWPSdk.Json;

namespace WeiboWPSdk.ResponseEntity {
    /// <summary>
    /// 微博
    /// </summary>
    public class Status : EntityBase {
        /// <summary>
        /// 微博创建时间
        /// </summary>
        [JsonProperty("created_at")]
        public string CreatedAt { get; internal set; }
        /// <summary>
        /// 微博ID
        /// </summary>
        [JsonProperty("id")]
        public long Id { get; internal set; }
        /// <summary>
        /// 微博MID
        /// </summary>
        [JsonProperty("mid")]
        public long MId { get; internal set; }
        /// <summary>
        /// 字符串型的微博ID
        /// </summary>
        [JsonProperty("idstr")]
        public string IdStr { get; internal set; }
        /// <summary>
        /// 微博信息内容
        /// </summary>
        [JsonProperty("text")]
        public string Text { get; internal set; }
        /// <summary>
        /// 微博来源
        /// </summary>
        [JsonProperty("source")]
        public string Source { get; internal set; }
        /// <summary>
        /// 是否已收藏，true：是，false：否
        /// </summary>
        [JsonProperty("favorited")]
        public bool Favorited { get; internal set; }
        /// <summary>
        /// 是否被截断，true：是，false：否
        /// </summary>
        [JsonProperty("truncated")]
        public bool Truncated { get; internal set; }
        /// <summary>
        /// 回复ID
        /// </summary>
        [JsonProperty("in_reply_to_status_id")]
        public string InReplyToStuatusID { get; internal set; }
        /// <summary>
        /// 回复人UID
        /// </summary>
        [JsonProperty("in_reply_to_user_id")]
        public string InReplyToUserID { get; internal set; }
        /// <summary>
        /// 回复人昵称
        /// </summary>
        [JsonProperty("in_reply_to_screen_name")]
        public string InReplyToScreenName { get; internal set; }
        /// <summary>
        /// 缩略图片地址，没有时不返回此字段
        /// </summary>
        [JsonProperty("thumbnail_pic")]
        public string ThumbnailPictureUrl { get; internal set; }
        /// <summary>
        /// 中等尺寸图片地址，没有时不返回此字段
        /// </summary>
        [JsonProperty("bmiddle_pic")]
        public string MiddleSizePictureUrl { get; internal set; }
        /// <summary>
        /// 原始图片地址，没有时不返回此字段
        /// </summary>
        [JsonProperty("original_pic")]
        public string OriginalPictureUrl { get; internal set; }
        /// <summary>
        /// 地理信息字段
        /// </summary>
        [JsonProperty("geo")]
        public Geo GEO { get; internal set; }
        /// <summary>
        /// 微博作者的用户信息字段
        /// </summary>
        [JsonProperty("user")]
        public User User { get; internal set; }
        /// <summary>
        /// 被转发的原微博信息字段，当该微博为转发微博时返回
        /// </summary>
        [JsonProperty("retweeted_status")]
        public Status RetweetedStatus { get; internal set; }
        /// <summary>
        /// 转发数
        /// </summary>
        [JsonProperty("reposts_count")]
        public int RepostsCount { get; internal set; }
        /// <summary>
        /// 评论数
        /// </summary>
        [JsonProperty("comments_count")]
        public int CommentsCount { get; internal set; }
        /// <summary>
        /// 表态数
        /// </summary>
        [JsonProperty("attitudes_count")]
        public int AttitudesCount { get; internal set; }
        /// <summary>
        /// 微博的可见性及指定可见分组信息
        /// </summary>
        [JsonProperty("visible")]
        public StatusVisible Visible { get; internal set; }
    }

    /// <summary>
    /// 微博的可见性及指定可见分组信息
    /// </summary>
    public class StatusVisible : EntityBase {
        /// <summary>
        /// 0：普通微博，1：私密微博，3：指定分组微博，4：密友微博
        /// </summary>
        [JsonProperty("type")]
        public int Type { get; internal set; }
        /// <summary>
        /// 分组的组号
        /// </summary>
        [JsonProperty("list_id")]
        public int ListId { get; internal set; }
    }

    public class StatusCollection : EntityBase {
        [JsonProperty("statuses")]
        public IEnumerable<Status> Statuses { get; internal set; }
        //[JsonProperty("advertises")]
        //public IEnumerable<object> Advertises { get; internal set; }
        //[JsonProperty("ad")]
        //public IEnumerable<object> Ad { get; internal set; }
        [JsonProperty("hasvisible")]
        public bool HasVisible { get; internal set; }
        //[JsonProperty("previous_cursor")]
        //public int PreviousCursor { get; internal set; }
        //[JsonProperty("next_cursor")]
        //public int NextCursor { get; internal set; }
        [JsonProperty("total_number")]
        public int TotalNumber { get; internal set; }
    }

    public class StatusIdCollection : EntityBase {
        [JsonProperty("statuses")]
        public IEnumerable<string> StatusIds { get; internal set; }
        //[JsonProperty("advertises")]
        //public IEnumerable<object> Advertises { get; internal set; }
        //[JsonProperty("ad")]
        //public IEnumerable<object> Ad { get; internal set; }
        [JsonProperty("hasvisible")]
        public bool HasVisible { get; internal set; }
        //[JsonProperty("previous_cursor")]
        //public int PreviousCursor { get; internal set; }
        //[JsonProperty("next_cursor")]
        //public int NextCursor { get; internal set; }
        [JsonProperty("total_number")]
        public int TotalNumber { get; internal set; }
    }

    public class RepostCollection : EntityBase {
        [JsonProperty("reposts")]
        public IEnumerable<Status> Reposts { get; internal set; }
        //[JsonProperty("advertises")]
        //public IEnumerable<object> Advertises { get; internal set; }
        //[JsonProperty("ad")]
        //public IEnumerable<object> Ad { get; internal set; }
        [JsonProperty("hasvisible")]
        public bool HasVisible { get; internal set; }
        //[JsonProperty("previous_cursor")]
        //public int PreviousCursor { get; internal set; }
        //[JsonProperty("next_cursor")]
        //public int NextCursor { get; internal set; }
        [JsonProperty("total_number")]
        public int TotalNumber { get; internal set; }
    }

    public class Status_Count : EntityBase {
        [JsonProperty("id")]
        public long Id { get; internal set; }
        [JsonProperty("comments")]
        public int Comments { get; internal set; }
        [JsonProperty("reposts")]
        public int Reposts { get; internal set; }
        [JsonProperty("attitudes")]
        public int Attitudes { get; internal set; }
    }
}
